/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scrvtbpubreper")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scrvtbpubreper.findAll", query = "SELECT s FROM Scrvtbpubreper s"),
    @NamedQuery(name = "Scrvtbpubreper.findByScrvtbpubreperid", query = "SELECT s FROM Scrvtbpubreper s WHERE s.scrvtbpubreperid = :scrvtbpubreperid"),
    @NamedQuery(name = "Scrvtbpubreper.findByConstadocente", query = "SELECT s FROM Scrvtbpubreper s WHERE s.constadocente = :constadocente")})
public class Scrvtbpubreper implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scrvtbpubreperid")
    private Integer scrvtbpubreperid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "constadocente")
    private boolean constadocente;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "scrvtbrepubrevid", referencedColumnName = "scrvtbrepubrevid")
    @ManyToOne(optional = false)
    private Scrvtbrepubrev scrvtbrepubrevid;

    public Scrvtbpubreper() {
    }

    public Scrvtbpubreper(Integer scrvtbpubreperid) {
        this.scrvtbpubreperid = scrvtbpubreperid;
    }

    public Scrvtbpubreper(Integer scrvtbpubreperid, boolean constadocente) {
        this.scrvtbpubreperid = scrvtbpubreperid;
        this.constadocente = constadocente;
    }

    public Integer getScrvtbpubreperid() {
        return scrvtbpubreperid;
    }

    public void setScrvtbpubreperid(Integer scrvtbpubreperid) {
        this.scrvtbpubreperid = scrvtbpubreperid;
    }

    public boolean getConstadocente() {
        return constadocente;
    }

    public void setConstadocente(boolean constadocente) {
        this.constadocente = constadocente;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Scrvtbrepubrev getScrvtbrepubrevid() {
        return scrvtbrepubrevid;
    }

    public void setScrvtbrepubrevid(Scrvtbrepubrev scrvtbrepubrevid) {
        this.scrvtbrepubrevid = scrvtbrepubrevid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scrvtbpubreperid != null ? scrvtbpubreperid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scrvtbpubreper)) {
            return false;
        }
        Scrvtbpubreper other = (Scrvtbpubreper) object;
        if ((this.scrvtbpubreperid == null && other.scrvtbpubreperid != null) || (this.scrvtbpubreperid != null && !this.scrvtbpubreperid.equals(other.scrvtbpubreperid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scrvtbpubreper[ scrvtbpubreperid=" + scrvtbpubreperid + " ]";
    }
    
}
